const connection = require('./db') // 获取连接实例

exports.getmessage = function (req, res, next) {
    console.log(req.url);
    connection.query('select * from comments', (err, comments) => {
        if (err) {
          res.send('query error')
        } else {
          // 将 MySQL 查询结果作为路由返回值
          res.send(comments)
        }
      })
}
